<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/12/27
  Time: 21:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
</script>
<script>
    function a(){
        $.ajax({
            url:'http://localhost:8080/springdept/dept/user',
            type:'POST', //GET
            async:true,    //或false,是否异步
            data:"id: 1002||name: andy||birthday: 2020/2/3||balance: 5000",
            contentType:"a/b",
            timeout:5000,    //超时时间
            success:function(data){
            }
        })
    }

    function b(){
        $.ajax({
            url:'http://localhost:8080/springdept/dept/user',
            type:'POST', //GET
            async:true,    //或false,是否异步
            data:"{ \"id\": 1002, \"name\": \"andy\",\"birthday\": \"2020/2/3\",\"balance\": 5000}",
            contentType:"application/json",
            timeout:5000,    //超时时间
            success:function(data){
            }
        })
    }
</script>
<body>
<button value="go" onclick="a()">go</button>
<button value="go" onclick="b()">go2</button>
<form action="/springdept/file/upload" method="post" enctype="multipart/form-data">
    <input type="file" name="file">
    <input type="submit" name="submit">
</form>
</body>
</html>
